/****************************************************************************
** Form implementation generated from reading ui file 'form1.ui'
**
** Created: Seg Abr 7 22:42:28 2008
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "form1.h"

#include <qvariant.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include <qimage.h>
#include <qpixmap.h>

#include "form1.ui.h"
/*
 *  Constructs a MainWindow as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
MainWindow::MainWindow( QWidget* parent, const char* name, WFlags fl )
    : QMainWindow( parent, name, fl )
{
    (void)statusBar();
    if ( !name )
	setName( "MainWindow" );

    // actions
    estruturasListaAction = new QAction( this, "estruturasListaAction" );
    estruturasLista_CircularAction = new QAction( this, "estruturasLista_CircularAction" );
    estruturasFilaAction = new QAction( this, "estruturasFilaAction" );
    estruturasPilhaAction = new QAction( this, "estruturasPilhaAction" );
    exercciosPalindromoAction = new QAction( this, "exercciosPalindromoAction" );
    exercciosOrdenaoAction = new QAction( this, "exercciosOrdenaoAction" );
    exercciosTorre_de_HanoiAction = new QAction( this, "exercciosTorre_de_HanoiAction" );
    Action = new QAction( this, "Action" );
    exercciosTo_pos_fixoAction = new QAction( this, "exercciosTo_pos_fixoAction" );
    exercciospos_fixo_SolverAction = new QAction( this, "exercciospos_fixo_SolverAction" );


    // toolbars


    // menubar
    MenuBarEditor = new QMenuBar( this, "MenuBarEditor" );


    Estruturas = new QPopupMenu( this );
    estruturasListaAction->addTo( Estruturas );
    estruturasLista_CircularAction->addTo( Estruturas );
    estruturasFilaAction->addTo( Estruturas );
    estruturasPilhaAction->addTo( Estruturas );
    MenuBarEditor->insertItem( QString(""), Estruturas, 1 );

    MenuBarEditor->insertSeparator( 2 );

    Exerccios = new QPopupMenu( this );
    exercciosPalindromoAction->addTo( Exerccios );
    exercciosOrdenaoAction->addTo( Exerccios );
    exercciosTorre_de_HanoiAction->addTo( Exerccios );
    Action->addTo( Exerccios );
    exercciosTo_pos_fixoAction->addTo( Exerccios );
    exercciospos_fixo_SolverAction->addTo( Exerccios );
    MenuBarEditor->insertItem( QString(""), Exerccios, 3 );

    languageChange();
    resize( QSize(600, 480).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( estruturasListaAction, SIGNAL( activated() ), this, SLOT( newLista() ) );
    connect( estruturasLista_CircularAction, SIGNAL( activated() ), this, SLOT( newListaCircular() ) );
    connect( estruturasFilaAction, SIGNAL( activated() ), this, SLOT( newFila() ) );
    connect( estruturasPilhaAction, SIGNAL( activated() ), this, SLOT( newPilha() ) );
    connect( exercciosTorre_de_HanoiAction, SIGNAL( activated() ), this, SLOT( newHanoi() ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
MainWindow::~MainWindow()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MainWindow::languageChange()
{
    setCaption( tr( "Trabalho de ED.1" ) );
    estruturasListaAction->setText( tr( "Lista" ) );
    estruturasListaAction->setMenuText( tr( "Lista" ) );
    estruturasLista_CircularAction->setText( tr( "Lista Circular" ) );
    estruturasLista_CircularAction->setMenuText( tr( "Lista Circular" ) );
    estruturasFilaAction->setText( tr( "Fila" ) );
    estruturasFilaAction->setMenuText( tr( "Fila" ) );
    estruturasPilhaAction->setText( tr( "Pilha" ) );
    estruturasPilhaAction->setMenuText( tr( "Pilha" ) );
    exercciosPalindromoAction->setText( tr( "Palindromo" ) );
    exercciosPalindromoAction->setMenuText( tr( "Palindromo" ) );
    exercciosOrdenaoAction->setText( trUtf8( "\x4f\x72\x64\x65\x6e\x61\xc3\xa7\xc3\xa3\x6f" ) );
    exercciosOrdenaoAction->setMenuText( trUtf8( "\x4f\x72\x64\x65\x6e\x61\xc3\xa7\xc3\xa3\x6f" ) );
    exercciosTorre_de_HanoiAction->setText( tr( "Torre de Hanoi" ) );
    exercciosTorre_de_HanoiAction->setMenuText( tr( "Torre de Hanoi" ) );
    Action->setText( tr( "Aninhamento" ) );
    exercciosTo_pos_fixoAction->setText( tr( "To pos-fixo" ) );
    exercciosTo_pos_fixoAction->setMenuText( tr( "To pos-fixo" ) );
    exercciospos_fixo_SolverAction->setText( tr( "pos-fixo Solver" ) );
    exercciospos_fixo_SolverAction->setMenuText( tr( "pos-fixo Solver" ) );
    if (MenuBarEditor->findItem(1))
        MenuBarEditor->findItem(1)->setText( tr( "Estruturas" ) );
    if (MenuBarEditor->findItem(3))
        MenuBarEditor->findItem(3)->setText( trUtf8( "\x45\x78\x65\x72\x63\xc3\xad\x63\x69\x6f\x73" ) );
}

